﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using Catel.Data;

namespace LprConfiger.Models
{
    /// <summary>
    /// 
    /// </summary>
#if !SILVERLIGHT
    [Serializable]
#endif
    public class Machine : DataObjectBase<Machine>
    {
        #region Variables
        #endregion

        #region Constructor & destructor
        /// <summary>
        /// Initializes a new object from scratch.
        /// </summary>
        public Machine() { }

#if !SILVERLIGHT
        /// <summary>
        /// Initializes a new object based on <see cref="SerializationInfo"/>.
        /// </summary>
        /// <param name="info"><see cref="SerializationInfo"/> that contains the information.</param>
        /// <param name="context"><see cref="StreamingContext"/>.</param>
        protected Machine(SerializationInfo info, StreamingContext context)
            : base(info, context) { }
#endif
        #endregion

        #region Properties
        // TODO: Define your custom properties here using the dataprop code snippet

        /// <summary>
        /// 全局信息.
        /// </summary>
        public StationInfo GeneralInfo
        {
            get { return GetValue<StationInfo>(GeneralInfoProperty); }
            set { SetValue(GeneralInfoProperty, value); }
        }

        /// <summary>
        /// Register the GeneralInfo property so it is known in the class.
        /// </summary>
        public static readonly PropertyData GeneralInfoProperty = RegisterProperty("GeneralInfo", typeof(StationInfo), new StationInfo());


        /// <summary>
        /// 摄像头.
        /// </summary>
        public ObservableCollection<Camera> Cameras
        {
            get { return GetValue<ObservableCollection<Camera>>(CamerasProperty); }
            set { SetValue(CamerasProperty, value); }
        }

        /// <summary>
        /// Register the name property so it is known in the class.
        /// </summary>
        public static readonly PropertyData CamerasProperty = RegisterProperty("Cameras", typeof(ObservableCollection<Camera>), new ObservableCollection<Camera>());

        #endregion

        #region Methods
        /// <summary>
        /// Validates the fields.
        /// </summary>
        protected override void ValidateFields()
        {
            // TODO: Implement any field validation of this object. Simply set any error by using the SetFieldError method
        }

        /// <summary>
        /// Validates the business rules.
        /// </summary>
        protected override void ValidateBusinessRules()
        {
            // TODO: Implement any business rules of this object. Simply set any error by using the SetBusinessRuleError method
        }
        #endregion
    }
}
